<template>
  <view class="container">
    <yh_input
      label="设计开始时间"
      placeholder="请选择"
      :required="true"
      :disabled="true"
      :image="true"
      v-model="desc.value"
      @click="open(true)"
    />
    <nut-datepicker
      v-model="currentDate"
      @confirm="confirm"
      v-model:visible="show"
      :is-show-chinese="false"
    ></nut-datepicker>
  </view>
</template>
<script lang="ts">
import { reactive, toRefs, ref } from "vue";
import yh_input from "@/components/yh-input.vue";

export default {
  name: "design",
  components: { yh_input },
  setup() {
    const desc = ref("2020-1-1");
    const state = reactive({
      currentDate: "",
      show: false,
    });
    return {
      ...toRefs(state),
      desc,
      open: (val: boolean) => {
        state.show = val;
      },
      confirm: (res: string) => {
        desc.value = res;
      },
    };
  },
};
</script>
<style lang="scss">
</style>